package com.garry.common.util;

import com.garry.common.dto.UserDto;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.SimpleAuthenticationInfo;

/**
 * Created by Administrator on 2017/1/29.
 */
public class AuthenticationUtil {

    public static boolean isLogin(){
        return SecurityUtils.getSubject().isAuthenticated();
    }

    public static UserDto getUserInfo(){
        return (UserDto) SecurityUtils.getSubject().getPrincipal();
    }
}
